package com.cloudm.technician.ui.modules.cloudm_box.machine_history

import com.cloudm.technician.data.network.CloudmBoxApi
import com.cloudm.technician.ui.base.RxPresenter

/**
 * 作者: wesley
 * 时间: 2017/12/25
 * 描述: 业务逻辑
 */
class MachineHistoryPresenter(private val view: MachineHistoryContract.View,
                              private val cloudmBoxApi: CloudmBoxApi) : RxPresenter(),
        MachineHistoryContract.Presenter {


    override fun getMachineHistoryInfo(page: Int, size: Int) {
        request(cloudmBoxApi.getMachineHistoryInfo(page, size), view,
                onSuccess = { list, loadMoreInfo ->
                    view.loadSuccess(list, loadMoreInfo)
                }, onFailure = { errorMsg ->
            view.loadFailure(errorMsg)
        })
    }
}